﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Ninject.Modules;
using CSP.Receipts.Business;
using CSP.EFPF.Common;
using MySharpReceipts.Models;

namespace MySharpReceipts.Infrastructure
{
    public class ProductionModule : NinjectModule
    {
        public override void Load()
        {
            Bind<IUnitOfWork<CSP.Receipts.DataModel.ReceiptContext>>().To<TransactionScopeUnitOfWork<CSP.Receipts.DataModel.ReceiptContext>>().InRequestScope();
            
            Bind<IReceiptRepository>().To<ReceiptManager>().InRequestScope();
            Bind<IPictureRepository>().To<PictureManager>().InRequestScope();
            Bind<IUserRepository>().To<UserManager>().InRequestScope();
            Bind<ICategoryRepository>().To<CategoryManager>().InRequestScope();

            Bind<IFormsAuthenticationService>().To<Models.FormsAuthenticationService>();
            Bind<Models.IMembershipService>().To<AccountMembershipService>();
        }
    }
}